From d64229f1458ea32cb69e9d1ca770ec4790c628f7 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 23 Dec 2008 21:05:33 +0000 Subject: [PATCH] (Bug 16677) Media: view URLs should HTTP-redirect to canonical File: namespace --- includes/Wiki.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/Wiki.php b/includes/Wiki.php index c5f745d3c1..2e00cdeba7 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -218,6 +218,10 @@ class MediaWiki { } else if( NS_SPECIAL == $title->getNamespace() ) { /* actions that need to be made when we have a special pages */ SpecialPage::executePath( $title ); + } else if( NS_MEDIA == $title->getNamespace() ) { + global $wgOut; + $fileTitle = Title::makeTitle( NS_FILE, $title->getDBKey() ); + $wgOut->redirect( $fileTitle->getFullUrl() ); } else { /* Try low-level file cache hit */ if( $title->getNamespace() != NS_MEDIAWIKI && HTMLFileCache::useFileCache() ) { -- 2.20.1